from functools import wraps

"""
装饰器第一步
"""

def require_init(fn):
    @wraps(fn)
    def war(*args,**kwargs):
       dis = [i for i in kwargs.values()]
       lis = list(args) + dis
       for value in lis:
           if not isinstance(value,int):
               raise TypeError("类型错误")
       return fn(*args,**kwargs)

    return war


@require_init
def add(x,y):
    return x+y




if __name__ == "__main__":
    res = add(2,3)
    print(res)
    print(add.__name__)

